<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@ taglib uri="http://www.springframework.org/tags/form" prefix="form" %>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<html>
<head>
    <script type="text/javascript" src="js/jquery.validate.js"></script>
    <link href="css/index_work.css" rel="stylesheet">
    <script src="js/jquery-1.8.2.min.js"></script>
    <title>666</title>
</head>

<body>
<a href="add.jsp"><input type="button" value="添加"></a>
<form action="list" method="post">
    <input type="text" name="mname"><br>
    <input type="submit" name="查询"><br>
</form>
<table>
    <tr>
       <td>电影编号</td>
       <td>电影名称</td>
       <td>剧情介绍</td>
       <td>电影导演</td>
       <td>发行日期</td>
       <td>电影分类</td>
       <td>操作</td>
    </tr>
    <c:forEach items="${slist.list1}" var="aa">
    <tr>
        <td>${aa.mid}</td>
        <td>${aa.mname}</td>
        <td>${aa.mcon}</td>
        <td>${aa.users}</td>
        <td>${aa.mdate}</td>
        <td><c:forEach items="${aa.typeaList}" var="tt">
            ${tt.cname}
        </c:forEach> </td>
        <td><input type="button" value="删除" onclick="del(${aa.mid})"></td>
    </tr>
    </c:forEach>
    <tr>

        <td colspan="10">
            总共/${slist.pages}/页 当前${slist.pageNum}页 ${slist.pageNum}
             <a href="list1?pageNum?${slist.firstPage}">首页</a>
             <a href="list1?pageNum?${slist.prePage}">上一页</a>
             <a href="list1?pageNum?${slist.nextPage}">下一页</a>
             <a href="list1?pageNum?${slist.lastPage}">末页</a>
        </td>
    </tr>
</table>
<script>
    function del(mid) {
   $.post("del",{"mid":mid},function (res) {
         if (res > 0){
             alert("删除成功");
             location="list";
         }else{
             alert("删除失败");
         }
   })
    }

</script>
</body>
</html>
